import React from "react";
import { AntOutline } from "antd-mobile-icons";
import { useDispatch, useSelector } from "react-redux";
import styles from "../css/Chang.module.css";
import { CloseCircleFill } from 'antd-mobile-icons'
import { qingkong } from "../../../qie/slice/ticket";
function Changyong() {
  const dispath=useDispatch()
  const sousuoheji = useSelector((store) => store.ticket.sousuoheji);
  return (
    <div className={styles.dabox} style={{display:sousuoheji.length===0?'none':'block'}}>
      <h4>常搜索历史</h4>
      <span className={styles.span1} onClick={()=>dispath(qingkong())}><CloseCircleFill /></span>
      <div className={styles.box}>
        {
          sousuoheji.map((item,index)=><span key={index}>
            {item}
          </span>)
        }
      </div>
    </div>
  );
}

export default Changyong;
